1. Field of the Invention
The present invention relates to a recording apparatus, a file descriptor generation method, and a program.
2. Description of the Related Art
In kernels of UNIX (registered trademark), LINUX (registered trademark), and the like, file descriptors are employed as a mechanism for processes and threads to operate an object such as a file and a socket. The file descriptors are managed by a process table for each process, and their entities are mere numbers sequentially assigned by the kernel. In the process table, an index to an entry of a kernel file table is registered in association with the file descriptor. As an entry corresponding to the indices of the kernel file table, an index to a data structure of the object such as a file or a socket is registered.
Japanese Patent Application Laid-open No. 2006-127461 (paragraph [0084]) discloses communication processing between a client and a server using a file descriptor. After allocating a file descriptor to a socket created by a socket system call using a bind system call, a server-side process executes a listen system call and sets a getting-ready-for-connection status. Meanwhile, a client-side process creates a socket by the socket system call and establishes a communication path with respect to the server-side socket using a connect system call. The server-side process executes an accept system call and accepts a request from the client-side process. After completion of the connection, a write system call as write processing and a read system call as read processing with respect to a file descriptor corresponding to the socket are used to realize message transmission/reception.